import App from './App'
import store from '@/store';
import uView from "uview-ui";
import Vue from 'vue'

Vue.config.productionTip = false
App.mpType = 'app'

Vue.use(uView);

let vuexStore = require("@/store/$u.mixin.js");
Vue.mixin(vuexStore);
Vue.mixin({
	methods: {
		call_phone(phone) {
			uni.showModal({
				title: '确定拨打电话？',
				success: (res) => {
					if (res.confirm) {
						uni.makePhoneCall({
							phoneNumber: phone
						})
					}
				}
			})
		},
		// previewImage(e) {
		// 	var imgurl = e.currentTarget.dataset.url
		// 	var imgurls = e.currentTarget.dataset.urls
		// 	if (!imgurls) imgurls = imgurl;
		// 	if (typeof(imgurls) == 'string') imgurls = imgurls.split(',');
		// 	uni.previewImage({
		// 		current: imgurl,
		// 		urls: imgurls
		// 	})
		// },
		navigateTo(url) {
			uni.navigateTo({
				url
			})
		},
		//跳转到协议详情页面
		goXieyi(gid, oid) {
			this.$u.route({
				url: '/pages/index/html-detail',
				params: {
					title: '认养协议',
					url: encodeURIComponent(`/api/ry_xieyi_xq?gid=${gid}&oid=${oid}`)
				}
			})
		},
		goIndex() {
			uni.switchTab({
				url: '/pages/index/index'
			})
		},
	}
})




import * as api from './config/api.js'
for (let key in api) {
	Vue.prototype[key] = api[key]
}

const app = new Vue({
	store,
	...App
})


require('@/config/request.js')(app)

app.$mount()